num = 0

def infinite_sequence():
    while True:
        num += 1
        yield num


# 生成无限递增数字（不会卡死）
for i in infinite_sequence():
    if i > 100:
        break
    # print(i)